﻿using HSJM.Service.MWS.Application.Models;
using HSJM.Service.MWS.Domain;
using HSJM.Service.MWS.Domain.Entitys;
using HSJM.Service.MWS.Infrastructure;
using StackExchange.Profiling;
using System;
using System.Collections.Generic;
using System.Text;
using AutoMapper;
using HSJM.Service.MWS.Application;
using HSJM.Service.MWS.Application.Application.Base;
using HSJM.Service.MWS.Domain.Domain.Base;
using HSJM.Service.MWS.Core;
using System.Threading.Tasks;
using HSJM.Service.MWS.Utility;
using HSJM.Service.MWS.Domain.Condition;

namespace HSJM.Service.MWS.Application.Application
{
    public class TestService : BaseApplication<Test,BaseTestCondition>, ITestService
    {
        ITestDomain  _baseDomain { get; set; }
        RedisHelper _redisHelper { get; set; }
        public TestService(ITestDomain baseDomain, RedisHelper redisHelper) :base(baseDomain)
        {
            _baseDomain = baseDomain;
            _redisHelper= redisHelper;
        }

        [Transactional]
        public override async Task <Test> GetAsync(long id)
        {
            using (MiniProfiler.Current.Step("一个测试"))
            {
               var a=await  _redisHelper.Get("济南比亚迪二期:数据表:MainStationKey").ConfigureAwait(false);

                var test =await _baseDomain.GetAsync(id);
                return test;
            }
        }
    }
}
